<template>
	<view>
		<free-nav-bar title="扫一扫" showBack :showCloseRigh="true"></free-nav-bar>
		<button @click="sao">扫一扫结果</button>
	</view>
</template>

<script>
	import freeNavBar from "@/components/free-ui/free-nav-bar.vue"
	export default {
		components: {
			freeNavBar
		},
		data() {
			return {
				result: ''
			}
		},
        
		onLoad() {
			// 在需要调用扫一扫功能的页面中
			uni.scanCode({
			  success: (res) => {
			    console.log('扫码成功', res);
			    // 处理扫码结果
				
				
			  },
			  fail: (err) => {
			    console.error('扫码失败', err);
			    // 处理扫码失败情况
			  }
			});
		},
		methods: {
			sao(){
				uni.navigateTo({
					url:'/pages/tabbar/index/queryDetails'
				})
			}
		}
	}
</script>

<style>

</style>